import request from '@/utils/request'

// 获取任务类型下拉列表
export function getTaskTypeList() {
  return request({
    url: '/operation/web/operationWorkOrderTask/taskTypeList',
    method: 'get'
  })
}

// 获取工单模板下拉列表
export function getWorkOrderTypeList() {
  return request({
    url: '/operation/web/operationWorkOrderTask/workOrderTypeList',
    method: 'get'
  })
}

// 获取构筑物下拉列表
export function getStructureList() {
  return request({
    url: '/operation/web/operationWorkOrderTask/structureList',
    method: 'get'
  })
}

// 查询工单任务信息列表
export function listWorkOrderTask(params) {
  return request({
    url: '/operation/web/operationWorkOrderTask/list',
    method: 'get',
    params
  })
}

// 获取工单任务详细信息
export function getWorkOrderTask(taskId) {
  return request({
    url: `/operation/web/operationWorkOrderTask/${taskId}`,
    method: 'get'
  })
}

// 新增工单任务信息
export function addWorkOrderTask(data) {
  return request({
    url: '/operation/web/operationWorkOrderTask',
    method: 'post',
    data
  })
}

// 修改工单任务信息
export function updateWorkOrderTask(data) {
  return request({
    url: '/operation/web/operationWorkOrderTask',
    method: 'put',
    data
  })
}

// 删除工单任务信息
export function deleteWorkOrderTask(taskIds) {
  return request({
    url: `/operation/web/operationWorkOrderTask/${taskIds}`,
    method: 'delete'
  })
}

// 批量关联模板
export function batchAssociateTemplate(data) {
  return request({
    url: '/operation/web/operationWorkOrderTask/batch',
    method: 'post',
    data
  })
}